import { createApp } from 'vue'
import {
  ElButton,
  ElContainer,
  ElAside,
  ElMenu,
  ElSubMenu,
  ElMenuItemGroup,
  ElMenuItem
} from 'element-plus'
import App from './App.vue'
import router from '@/router'
import RootNav from './components/RootNav.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App) // 生成 Vue 实例 app

app.use(router) // 引用路由实例
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElButton)
  .use(ElContainer)
  .use(ElAside)
  .use(ElMenu)
  .use(ElSubMenu)
  .use(ElMenuItemGroup)
  .use(ElMenuItem)
app.component('RootNav', RootNav)
app.mount('#app') // 挂载到 #app
